package yunjiao.designpatterns.builder;

import yunjiao.designpatterns.builder.food.beverages.BeverageSize;
import yunjiao.designpatterns.builder.food.beverages.CocaCola;
import yunjiao.designpatterns.builder.food.beverages.HotChocolate;
import yunjiao.designpatterns.builder.food.beverages.Pepsi;
import yunjiao.designpatterns.builder.food.burger.ChickenBurger;
import yunjiao.designpatterns.builder.food.nuggets.CheeseNuggets;
import yunjiao.designpatterns.builder.food.nuggets.ChickenNuggets;

/**
 * 入口
 *
 * @author yangyunjiao
 */
public class App {
    public static void main(String[] args) {
        OrderBuilder builder1 = new OrderBuilder();
        // you can see the use of chained calls of setters here. No statement terminator
        // till we set all the values of the object
        Order meal1 = builder1.name("Brijesh").orderType(OrderType.TAKE_AWAY).item(new ChickenBurger())
                .item(new Pepsi(BeverageSize.M)).vegNuggetsHappyMeal().build();

        BillPrinter.printItemisedBill(meal1);


        OrderBuilder builder2 = new OrderBuilder();
        Order meal2 = builder2.name("Micheal").orderType(OrderType.EAT_HERE).item(new ChickenNuggets())
                .item(new CheeseNuggets()).item(new CocaCola(BeverageSize.L)).chickenBurgerHappyMeal()
                .item(new HotChocolate(BeverageSize.M)).vegBurgerHappyMeal().build();

        BillPrinter.printItemisedBill(meal2);
    }
}
